package com.yixing.tech.common.convert;

import java.util.Objects;

public class StringToBooleanConverter implements Converter<String, Boolean> {

    @Override
    public Boolean convert(String source) {
        if(Objects.equals("true", source)) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public Class<String> getSourceType() {
        return String.class;
    }

    @Override
    public Class<Boolean> getTargetType() {
        return Boolean.class;
    }

}
